package com.symc.sims0213xfw.controller.student;

import com.symc.sims0213xfw.service.OperationStatusResult;
import com.symc.sims0213xfw.service.impl.StudentViewServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author: 凤文  沈阳医学院2019级医学信息工程 0213
 * @CreateTime: 2022/01/22 19:56
 * @Description:
 */
@WebServlet("/listStudentViewServlet")
public class ListStudentViewServlet extends HttpServlet implements OperationStatusResult {
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        long time = System.currentTimeMillis();
        req.getSession().setAttribute("studentViews",
                new StudentViewServiceImpl().getStudentViews());
        System.out.println(System.currentTimeMillis() - time);
        resp.sendRedirect(req.getContextPath() + "/jsp/student/listStudent.jsp");
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
